{% extends "enterprise/base.html" %}
{% block css %}
<link rel="stylesheet" type="text/css" href="/static/images/skin/minimal/blue.css">
    <link rel="stylesheet" type="text/css" href="http://61.155.4.230:8807/arcgis_js_api/library/3.1/jsapi/js/dojo/dijit/themes/claro/claro.css">
{% endblock %}
{% block content %}

<script type="text/javascript">
    var primary_menu = "menu_0";
    var sub_menu = "menu_0_0";
</script>
<form class="formSubmit" method="post" enctype="multipart/form-data">
{#<div class="col-md-12">#}
{#    <div class="panel panel-primary">#}
{#        <div class="panel-heading">#}
{#            <div class="panel-title"><h3>经办人信息</h3></div>#}
{#            <div class="panel-options">#}
{#                <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a>#}
{#                <!--<a href="#" data-rel="reload"><i class="entypo-arrows-ccw"></i></a>-->#}
{#            </div>#}
{#        </div>#}
{#        <div class="panel-body with-table">#}
{#            <div class="panel-body with-table" style="padding:0px;">#}
{#                <table class="input_in table-detail">#}
{#                    <tr>#}
{#                        <th width='15%'>填报人员</th>#}
{#                        <td width='40%'><input type="text" name="fill_people" placeholder="请输入" value="{{ basic.fill_people }}" datatype="*"></td>#}
{#                        <th width='15%'>Mail</th>#}
{#                        <td width='30%'><input type="text" name="mail" placeholder="请输入" value="{{ basic.mail }}" datatype="e"></td>#}
{#                    </tr>#}
{#                    <tr>#}
{#                        <th width='15%'>固定电话</th>#}
{#                        <td width='40%'><input type="text" name="local_phone" placeholder="请输入" value="{{ basic.local_phone }}" datatype="*"></td>#}
{#                        <th width='15%'>移动电话</th>#}
{#                        <td width='30%'><input type="text" name="mobile_phone" value="{{ basic.mobile_phone }}" placeholder="请输入" datatype="m"></td>#}
{#                    </tr>#}
{#                    <tr>#}
{#                        <th width='15%'>传真</th>#}
{#                        <td width='40%'><input type="text" name="fax" placeholder="请输入" value="{{ basic.fax }}" datatype="*"></td>#}
{#                        <th width='15%'>邮政编码</th>#}
{#                        <td width='30%'><input type="text" name="postal_code" value="{{ basic.postal_code }}" placeholder="请输入" datatype="p"></td>#}
{#                    </tr> #}
{#                    </table> #}
{#            </div>#}
{#        </div>#}
{#    </div>#}
{#</div>#}
<div class="col-md-12">
    
        <div class="panel panel-primary">
            <div class="panel-heading">
                <div class="panel-title"><h3>企业基本情况</h3></div>
                <div class="panel-options">
                    <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a>
                    <!--<a href="#" data-rel="reload"><i class="entypo-arrows-ccw"></i></a>-->
                </div>
            </div>
            <div class="panel-body with-table">
                <div class="panel-body with-table" style="padding:0px;">
                    <table class="input_in table-detail">
                        <tr>
                            <th width='15%'>企业名称</th>
                            <td width='85%' colspan="3"><input type="text" name="enterprise_name" placeholder="请输入" value="{{basic.enterprise_name}}" datatype="*"></td>
                        </tr>
                        <tr>
                            <th width='15%'>企业法人</th>
                            <td width='40%'><input type="text" name="legal_person" placeholder="请输入" value="{{basic.legal_person}}" datatype="*"></td>
                            <th width='15%'>法人联系方式</th>
                            <td width='30%'><input type="text" name="legal_person_information" value="{{basic.legal_person_information}}" placeholder="请输入" datatype="*"></td>
                        </tr>
                        <tr>
                            <th width='15%'>企业环保负责人管理员</th>
                            <td width='40%'><input type="text" name="company_contact" placeholder="请输入" value="{{basic.company_contact}}" datatype="*"></td>
                            <th width='15%'>联系方式</th>
                            <td width='30%'><input type="text" name="company_contact_information" value="{{basic.company_contact_information}}" placeholder="请输入" datatype="*"></td>
                        </tr>
                        
                        
                        <tr>
                            <th>组织机构代码</th>
                            <td colspan="3">
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.0}}" datatype="n">
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.1}}" datatype="n">
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.2}}" datatype="n">
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.3}}" datatype="n">
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.4}}" datatype="n">
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.5}}" datatype="n">
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.6}}" datatype="n">
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.7}}" datatype="n">
                                <span>-</span>
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.8}}" datatype="n">
                                <span>（</span>
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.9}}" datatype="n">
                                <input class="limit" type="text" name="organization_code" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);" value="{{basic.organization_code.10}}" datatype="n">
                                <span>）</span>
                            </td>
                            <!-- <th>截止日期</th>
                            <td>
                                <input class="Wdate time" type="text"  name="operation_term" value="{{basic.operation_term}}"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="*"/> -->
                                <!-- <input type="text" name="operation_term" placeholder="请输入"   value=""  datatype="*"></td> -->
                        </tr>
                        <tr>
                            <th>工商注册号<!-- （附营业执照复印件） --></th>
                            <td colspan="3">
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.0}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.1}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.2}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.3}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.4}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.5}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.6}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.7}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.8}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.9}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.10}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.11}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.12}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.13}}" datatype="n" >
                                <input class="limit" type="text" name="registration_No" maxlength="1" onkeydown="tabKeyDown(this,event)" onkeyup="return tabOnEnter (this, event);"  value="{{basic.registration_No.14}}" datatype="n" >
                                <div style="float:left;">　
                                    <input style="width:200px;" type="text" value="{{business_license_photocopy}}" placeholder="--请选择--" datatype="img" errormsg="图片格式不正确！" readonly> <button class="btn-wihte" type="button" onclick="choseFile(this)">选择</button><input style="display:none;" type="file" name="business_license_photocopy" placeholder="请输入" value="">
                                    <a href="/{{basic.business_license_photocopy}}" target="_blank" style="color: blue;">[附件]</a></div></td>
                        </tr>
                        <!-- <tr>
                            <th>登记注册类型名称</th>
                            <td>
                                <select name="register_name" datatype="*">
                                    <option value="">--请选择--</option>
                                    {%for ke in registrations%}
                                        {%if  ke.name == basic.register_name %}
                                            <option  selected="selected" value="{{ke.name}}">{{ke.name}}</option>
                                        {%else%}
                                            <option value="{{ke.name}}">{{ke.name}}</option>
                                        {%endif%}
                                    {%endfor%}
                                </select></td>
                            <th>登记注册类型代码</th>
                            <td><input type="text" name="register_code" value="{{basic.register_code}}"    placeholder="请输入" datatype="*"></td>
                        </tr> -->
                        <tr>
                            <th>工商注册地址</th>
                            <td colspan="3">
                                <select class="choose-city" id="s_province" name="register_add0" datatype="*"  >
                                </select>
                                <select class="choose-city" id="s_city" name="register_add1" datatype="*"  >
                                </select>
                                <select class="choose-city" id="s_county" name="register_add2" datatype="*">
                                </select>
                                <input type="text" style="width:355px;float:left;" name="register_add_detail" placeholder="请输入详细地址" value="{{basic.register_add_detail}}" datatype="*" ></td>
                        </tr>
                        <tr>
                            <th>生产设施地址</th>
                            <td colspan="3">
                                <table style="width:100%;">
                                    <tr>
                                        <td style="padding:0px;">
                                            <select class="choose-city" id="m_province" name="facilities_add0" datatype="*"></select>
                                            <select class="choose-city" id="m_city" name="facilities_add1"  datatype="*"></select>
                                            <select class="choose-city" id="m_county" name="facilities_add2" datatype="*"></select>
                                            <input style="width:200px;float:left;margin-right:10px;" type="text" name="facilities_add_detail" placeholder="请输入详细地址" value="{{basic.facilities_add_detail}}" datatype="*">
                                            <input style="width:100px;float:left;margin-right:10px;" readonly="readonly" type="text"  name="lon" class="geo_x" placeholder="" value="{{basic.lon}}" datatype="*">
                                            <input style="width:100px;float:left;" readonly="readonly" type="text"  name="lat" class="geo_y" placeholder="" value="{{basic.lat}}" datatype="*">
                                            <img onclick="pickPosition(this.parentNode)" src="/static/images/city-index_6a99e92.jpg" style="width:30px;height:30px;border-radius:4px;border:1px solid #ccc;float:left;position:relative;top:2px;left:5px;">
                                        </td>
                                        <td width=60><input type="button" value="添加" class="btn btn-success" onclick="addFile(this)"></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <!-- <tr>
                            <th>中心经纬度</th>
                            <td colspan="3">
                                <input style="width:260px;float:left;" readonly="readonly" type="text"  name="lon" id="geo_x" placeholder="" value="{{basic.lon}}" datatype="*">
                                <input style="width:260px;float:left;" readonly="readonly" type="text"  name="lat" id="geo_y" placeholder="" value="{{basic.lat}}" datatype="*">
                                <img onclick="pickPosition()" src="/static/images/city-index_6a99e92.jpg" style="width:30px;height:30px;border-radius:4px;border:1px solid #ccc;float:left;position:relative;top:2px;left:5px;">
                            </td>
                            
                          
                        </tr> -->
                        <tr>
                            <th>是否进入工业园区</th>
                            <td colspan="3">
                            	{%if  basic.industry_park_time %}
                                <input type="radio" checked="checked" name="industry_park_time" value="1">是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="0" name="industry_park_time">否
                                {%else%}
                                <input type="radio" name="industry_park_time" value="1">是&nbsp;&nbsp;&nbsp;&nbsp;<input checked="checked"  type="radio" value="0" name="industry_park_time">否
                                {% endif %}
                            </td>
                        </tr>

                        <tr class="industryPark">
                            <th>工业园区名称</th>
                            <td colspan="3">
                            	<select name="industry_park_name">
                                {% for p in park %}
                                <option value="{{ p.name }}">{{ p.name }}</option>
                                {% endfor %}
                            	</select>
                            </td>
                        </tr>
                        <tr class="industryPark">
                            
                            <th>工业园区级别</th>
                            <td>
                                <select name="industry_park_level" datatype="*">
                                    <option value="">--请选择--</option>
                                    {%if  basic.industry_park_level == 1 %}
                                        <option selected="selected" value="1">国家级</option>
                                    {%else%}
                                        <option value="1">国家级</option>
                                    {% endif %}
                                    {%if basic.industry_park_level == 2%}
                                        <option value="2" selected="selected" >省级</option>
                                    {%else%}
                                        <option value="2">省级</option>
                                    {% endif %}
                                    {%if basic.industry_park_level == 3%}
                                        <option value="3" selected="selected">市级</option>
                                    {%else%}
                                        <option value="3">市级</option>
                                    {% endif %}
                                    {%if basic.industry_park_level == 4%}
                                        <option value="4" selected="selected" >其它</option>
                                    {%else%}
                                        <option value="4">其它</option>
                                    {% endif %}
                                </select></td>
                            <th>工业园区代码</th>
                            <td><input type="text"  name="industry_park_code" value="{{basic.industry_park_code}}"  placeholder="请输入" datatype="*"></td>
                        </tr>

                        <tr>
                            <th>行业分类名称</th>
                            <td>
                                <!-- <input type="text" name="industry_name"  value="{{basic.industry_name}}" placeholder="请输入"> -->
                                <select name="industry_name" datatype="*">
                                    <option value="">--请选择--</option>
                                    {%for ke in classifications%}
    	                                {%if  ke.name == basic.industry_name %}
    	                                	<option selected="selected" value="{{ke.name}}">{{ke.name}}</option>
    	                                {%else%}
    	                                	<option value="{{ke.name}}">{{ke.name}}</option>
    	                                {%endif%}
                                    {%endfor%}
                                </select></td>
                            <th>行业分类代码</th>
                            <td><input type="text" name="industry_code" value="{{basic.industry_code}}"  placeholder="请输入" datatype="*"></td>
                        </tr>
                        
                        <tr>
                            <th>注册资金(万元)</th>
                            <td><input type="text" name="registered_capital" value="{{basic.registered_capital}}"    placeholder="请输入" datatype="n"></td>
                            <th>工业总产值（万元）</th>
                            <td><input type="text" name="industrial_output" value="{{basic.industrial_output}}"    placeholder="请输入" datatype="n"></td>
                        </tr>



                        <tr>
                            <th>厂区面积（平方米）<!-- （附总平面布置图） --></th>
                            <td>
                                <input type="text" name="area" placeholder="请输入"  value="{{basic.area}}"  style="float:left;width:60px;" datatype="n">
                                <div style="float:left;margin-left:10px;">
{#                                    <input style="width:160px;" type="text" value="{{plane_layout}}" placeholder="--请选择--" datatype="img" errormsg="图片格式不正确！" readonly> <button class="btn-wihte" type="button" onclick="choseFile(this)">选择</button><input style="display:none;" type="file" name="plane_layout" placeholder="请输入" value="">#}
{#                                &nbsp;&nbsp;<a href="/{{basic.plane_layout}}" target="_blank" style="color: blue;">[附件]</a></div>#}
                            </td>
                            <th>平面布置<!-- （附总平面布置图） --></th>
                            <td>
                                <div style="float:left;margin-left:0px;">
                                    <input style="width:160px;" type="text" value="{{plane_layout}}" placeholder="--请选择--" datatype="img" errormsg="图片格式不正确！" readonly> <button class="btn-wihte" type="button" onclick="choseFile(this)">选择</button><input style="display:none;" type="file" name="plane_layout" placeholder="请输入" value="">
                                &nbsp;&nbsp;<a href="/{{basic.plane_layout}}" target="_blank" style="color: blue;">[附件]</a></div>
                            </td>
                        </tr>
                        <tr>
                            <!-- <th>年生产时间（小时）</th>
                            <td>
                                <input type="text"  name="annual_produce_time" value="{{ basic.annual_produce_time }}" datatype="n"/></td> -->
                            <th>企业人数（人）</th>
                            <td><input type="text" name="enterprise_number" value="{{basic.enterprise_number}}"  placeholder="请输入" datatype="sz"></td>
                            <th>企业规模</th>
                            <td>
                                <select name="scale" datatype="*">
                                    <option value="">--请选择--</option>
                                    {%if basic.scale == 1%}
                                    <option value="1" selected="selected">大型</option>
                                    {%else%}
                                    <option value="1">大型</option>
                                    {% endif %}
                                    {%if basic.scale == 2%}
                                    <option value="2" selected="selected">中型</option>
                                    {%else%}
                                    <option value="2">中型</option>
                                    {% endif %}
                                    {%if basic.scale == 3%}
                                    <option value="3" selected="selected">小型</option>
                                    {%else%}
                                    <option value="3">小型</option>
                                    {% endif %}
                                </select></td>
                        </tr>
                        <tr>
                            <th>建厂时间</th>
                            <td>
                                <input class="Wdate time" type="text"  name="opening_time" value="{{ basic.opening_time }}"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="*"/>
                            </td>
                            <th>最近改扩建时间</th>
                            <td>
                                <input class="Wdate time" type="text"  name="extension_time" value="{{ basic.extension_time }}"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="*" />
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div class="buttons">
            <input onclick="submitSave()" type="submit" class="btn btn-orange btn-lg" value="保存">
            <input type="submit" class="btn btn-success btn-lg" value="确认">
        </div>
    
</div>
</form>


{% endblock %}

{% block js %}

<script type="text/javascript" src="http://61.155.4.230:8807/arcgis_js_api/library/3.1/jsapi/init.js"></script>
<script type="text/javascript" src="/static/js/icheck.js"></script><!--选择条目 j-->
<script id="s1" type="text/javascript"></script>
<script src="/static/js/city-choose.js"></script>
<script language="javascript">
    var dizhi = "{{basic.facilities_add0}}";
    $(function(){
        var flag = $("input[name='parent_company']:checked").val();
        if (flag==1) {
            $(".parentCompany").show();
            $(".parentCompany").eq(0).find("input").attr("datatype","*");
            $(".parentCompany").eq(1).find("input").attr("datatype","n");
        }else{
            $(".parentCompany").hide().find("input").removeAttr('datatype');
        }
        var note = $("input[name='industry_park_time']:checked").val();
        if (note==1) {
            $(".industryPark").show();
            $(".industryPark").eq(0).find("input").attr("datatype","*");
            $(".industryPark").eq(1).find("input").attr("datatype","*");
        }else{
            $(".industryPark").hide().find("input").removeAttr('datatype');
        }
        $(document).area("s_province","s_city","s_county");//调用插件
        $(document).area("m_province","m_city","m_county");//调用插件
        $("#s_province,#m_province").trigger("change")

        $("input[name='parent_company']").click(function(){
            var flag = $("input[name='parent_company']:checked").val();
            console.log(flag)
            if (flag==1) {
                $(".parentCompany").show();
                $(".parentCompany").eq(0).find("input").attr("datatype","*");
                $(".parentCompany").eq(1).find("input").attr("datatype","n");
            }else{
                $(".parentCompany").hide().find("input").removeAttr('datatype');
            }
        })
        $("input[name='industry_park_time']").click(function(){
            var note = $("input[name='industry_park_time']:checked").val();
            console.log(note)
            if (note==1) {
                $(".industryPark").show();
                $(".industryPark").eq(0).find("input").attr("datatype","*");
                $(".industryPark").eq(1).find("input").attr("datatype","*");
            }else{
                $(".industryPark").hide().find("input").removeAttr('datatype');
            }
        })
        
    });
    var productPer;
    // $('#myMapModal').css("display","none");
    function pickPosition(obj)
        {   $('#myMapModal').modal("show");
             productPer = obj;
            document.getElementById("s1").src="/static/js/map.companyPositionPick.js"
            // drowWaterPoint();
        }
</script>
{% endblock %}
